<template>
  <div class="vir-fullscreen">
    <vir-table url="/api/sys/log/list.json" :manage="manage" v-on:table-row-current="doTableRowCurrent">
      <el-table-column type="selection" align="center" width="40" reserve-selection></el-table-column>
      <el-table-column prop="host" label="HOST"></el-table-column>
      <el-table-column prop="content" label="日志内容"></el-table-column>
      <el-table-column prop="createTime" label="创建时间"></el-table-column>
      <el-table-column label="操作" align="center">
        <el-button-group slot-scope="scope">
          <el-button @click="handleEdit(scope.$index, scope.row)">查看</el-button>
          <el-button @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
          <el-button type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        </el-button-group>
      </el-table-column>
    </vir-table>
  </div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { VirTable } from '@/components/table';

@Component({ components: { VirTable } })
export default class TablePage extends Vue {
  private doTableRowCurrent() {
    console.log(arguments);
  }

  private handleEdit(index: number, row: any) {
    console.log('handleEdit:' + index, row);
  }

  private handleDelete(index: number, row: any) {
    console.log('handleDelete:' + index, row);
  }
}
</script>
